package com.guohao.http;

import com.sun.net.httpserver.Headers;
import java.io.InputStream;
import java.util.Properties;

public class RequestInfo {

  private final RequestMethod requestMethod;
  private final String uri;
  private final Properties query = new Properties();
  private final InputStream body;
  private final Headers headers;

  public RequestInfo(String uri, InputStream body,
      Headers headers, String requestMethod) {
    this.uri = uri;
    this.body = body;
    this.headers = headers;
    this.requestMethod = RequestMethod.valueOf(requestMethod);
  }

  public RequestMethod getRequestMethod() {
    return requestMethod;
  }

  public String getUri() {
    return uri;
  }

  public Properties getQuery() {
    return query;
  }

  public InputStream getBody() {
    return body;
  }

  public Headers getHeaders() {
    return headers;
  }
}
